tools/ocaml/xenstored: Fix quota bypass on domain shutdown
authorEdwin Török <edvin.torok@citrix.com>
Wed, 12 Oct 2022 18:13:06 +0000 (19:13 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 1 Nov 2022 14:07:24 +0000 (14:07 +0000)
commit5b0919f2c0e5060f6e0bc328f100abae0a9f07b8
tree3474bbeafd9a82e97f77be320810ce50ea4e8fb1
parent1f5b394d6ed0ee26b5878bd0cdf4a698bbc4294f
tools/ocaml/xenstored: Fix quota bypass on domain shutdown

XSA-322 fixed a domid reuse vulnerability by assigning Dom0 as the owner of
any nodes left after a domain is shutdown (e.g. outside its /local/domain/N
tree).

However Dom0 has no quota on purpose, so this opened up another potential
attack vector. Avoid it by deleting these nodes instead of assigning them to
Dom0.

This is part of XSA-419 / CVE-2022-42323.

Fixes: c46eff921209 ("tools/ocaml/xenstored: clean up permissions for dead domains")
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
(cherry picked from commit db471408edd46af403b8bd44d180a928ad7fbb80)
tools/ocaml/xenstored/perms.ml
tools/ocaml/xenstored/store.ml